package com.itany.vo;

import com.itany.constant.ResponseStatusConstant;

import java.io.Serializable;

/**
 * Author：汤小洋
 * Date：2019-12-19 11:03
 * Description：<描述>
 */

public class ResponseResult  implements Serializable {

    private Integer code;
    private String msg;
    private Object data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static ResponseResult success(){
        ResponseResult result = new ResponseResult();
        result.setCode(ResponseStatusConstant.SUCCESS);
        result.setMsg("success");
        return result;
    }

    public static ResponseResult success(Object data){
        ResponseResult result = new ResponseResult();
        result.setCode(ResponseStatusConstant.SUCCESS);
        result.setMsg("success");
        result.setData(data);
        return result;
    }

    public static ResponseResult fail(String msg){
        ResponseResult result = new ResponseResult();
        result.setCode(ResponseStatusConstant.FAIL);
        result.setMsg(msg);
        return result;
    }
}
